# Contributor: James White <stegoxorus@gmail.com>
# Maintainer: James White <stegoxorus@gmail.com>
pkgname=py3-h5py
_pkgname=h5py
pkgver=2.10.0
pkgrel=1
pkgdesc="Read and write HDF5 files from Python"
url="https://www.h5py.org"
arch="all !s390x !x86 !ppc64le !mips !mips64" # x86|ppc64le -> numpy has no 128float support
license="BSD-3-Clause"
depends="py3-six py3-numpy hdf5"
makedepends="cython python3-dev hdf5-dev py3-setuptools py3-numpy-dev"
checkdepends="py3-pytest"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-h5py" # Backwards compatibility
provides="py-h5py=$pkgver-r$pkgrel" # Backwards compatibility

prepare() {
	default_prepare
	sed -i "s/settings\\['runtime_library_dirs'\\] = settings\\['library_dirs'\\]/pass/" setup_build.py
}

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="c49b04f7dcddf03f36d4f063d79ecbe544e0b1daee432d4a76cfa83dac3a1f2cb144f40a74fb85ea17cb5b778f57f709969ea5d1a2afc5bdd5aecbc9d732898d  h5py-2.10.0.tar.gz"
